////
////  MSQuarterReportFormViewController.m
////  觅尚
////
////  Created by No.8 on 2019/4/3.
////  Copyright © 2019 No.8. All rights reserved.
////
//
//#import "MSWeekReportFormController.h"
//
//#import "MSHomeCell.h"
//
//
//@interface MSWeekReportFormController ()<UITableViewDataSource,UITableViewDelegate>
///** 表视图*/
//@property(nonatomic,strong)UITableView *tableView;
//
///** accountingMoney*/
//@property(nonatomic,strong)NSString *accountingMoney;
//
//
///** aliPay*/
//@property(nonatomic,strong)NSString *aliPay;
//
///** bankCardPay*/
//@property(nonatomic,strong)NSString *bankCardPay;
//
//
///** cashPay*/
//@property(nonatomic,strong)NSString *cashPay;
//
///** memberCardMoney*/
//@property(nonatomic,strong)NSString *memberCardMoney;
//
///** membershipPay*/
//@property(nonatomic,strong)NSString *membershipPay;
//
///** otherMembershipMoney*/
//@property(nonatomic,strong)NSString *otherMembershipMoney;
//
//
///** otherMoney*/
//@property(nonatomic,strong)NSString *otherMoney;
//
///** otheraliPay*/
//@property(nonatomic,strong)NSString *otheraliPay;
//
//
///** otherbankCardPay*/
//@property(nonatomic,strong)NSString *otherbankCardPay;
//
///** othercashPay*/
//@property(nonatomic,strong)NSString *othercashPay;
//
//
///** otherweChat*/
//@property(nonatomic,strong)NSString *otherweChat;
//
//
///** repaymentMoney*/
//@property(nonatomic,strong)NSString *repaymentMoney;
//
///** rewardMoney*/
//@property(nonatomic,strong)NSString *rewardMoney;
//
///** totalIncome*/
//@property(nonatomic,strong)NSString *totalIncome;
//
///** weChat*/
//@property(nonatomic,strong)NSString *weChat;
//
///** weChatPay*/
//@property(nonatomic,strong)NSString *weChatPay;
//
///** updateTime*/
//@property(nonatomic,strong)NSString *updateTime;
//
///** <#name#>*/
//@property(nonatomic,strong)NSString  *statisticalTime;
//
//
//
//@end
//
//@implementation MSWeekReportFormController
//- (int)navBarBottom {
//    if ([WRNavigationBar isIphoneX]) {
//        return 88;
//    } else {
//        return 64;
//    }
//}
//- (void)viewWillAppear:(BOOL)animated {
//    [super viewWillAppear:YES];
//    self.navigationController.navigationBar.hidden = YES;
//
//    Prepare *header = [Prepare headerWithRefreshingTarget:self refreshingAction:@selector(MJChiBaoZiHeaderRefresh)];
//    // 隐藏时间
//    header.lastUpdatedTimeLabel.hidden = YES;
//    header.stateLabel.hidden = YES;
//    // 马上进入刷新状态
//    self.tableView.mj_header = header;
//    [self.tableView.mj_header beginRefreshing];
//}
//- (void)MJChiBaoZiHeaderRefresh{
//    //    [self.tableView.header beginRefreshing];
//    //    [self loadShowproduct];
//    [self ReloadData];
//
//}
//- (void)viewWillDisappear:(BOOL)animated {
//    [super viewWillDisappear:YES];
//    self.navigationController.navigationBar.hidden = YES;
//
//}
//- (void)viewDidLoad {
//    [super viewDidLoad];
//
//    [self tableView];
//
//    self.view.backgroundColor = WYCRGBColor(20, 33, 48);
//}
//
///** 表视图*/
//- (UITableView *)tableView{
//    self.extendedLayoutIncludesOpaqueBars = YES;
//    if (!_tableView) {
//
//        if (@available(iOS 11.0, *)) {
//
//            _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
//
//        } else {
//
//            self.automaticallyAdjustsScrollViewInsets = NO;
//
//        }
//        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - [self navBarBottom] - 100 * px) style:UITableViewStyleGrouped];
//        _tableView.delegate = self;
//        _tableView.dataSource = self;
//        _tableView.backgroundColor = [UIColor clearColor];
//        _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
//        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
//        [self.view addSubview:self.tableView];
//    }
//    return _tableView;
//}
//- (void)ReloadData{
//    NSDictionary * params = @{@"busId":[WYCAccountTool unarchivebelongBusid],@"queryTime":@"week"};
//    [HTTPRequest POST:MSgetBussinessIncomeRecord params:params succeed:^(id responseObject) {
//        WYCLog(@"----------%@",responseObject);
//        if (CodeStr) {
//
//            [self.tableView.mj_header endRefreshing];
//
//
//            self.accountingMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"accountingMoney"]];
//            self.aliPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"aliPay"]];
//            self.bankCardPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"bankCardPay"]];
//            self.cashPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"cashPay"]];
//            self.memberCardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"memberCardMoney"]];
//            self.membershipPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"membershipPay"]];
//            self.otherMembershipMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherMembershipMoney"]];
//            self.otherMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherMoney"]];
//            self.otheraliPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otheraliPay"]];
//            self.otherbankCardPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherbankCardPay"]];
//            self.othercashPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"othercashPay"]];
//            self.otherweChat = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"otherweChat"]];
//            self.repaymentMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"repaymentMoney"]];
//            self.rewardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"rewardMoney"]];
//            self.totalIncome = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"totalIncome"]];
//            self.weChat = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"weChat"]];
//            self.weChatPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"weChatPay"]];
//            self.weChatPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"weChatPay"]];
//            self.statisticalTime = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"statisticalTime"]];
//            self.updateTime = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"toDayIncome"][@"updateTime"]];
//        }else{
//            [self.tableView.mj_header endRefreshing];
//            [MBManager showBriefAlert:responseObject[@"msg"]];
//        }
//        [self.tableView reloadData];
//    } failure:^(NSError *error) {
//        [self.tableView.mj_header endRefreshing];
//        [MBManager showBriefAlert:Failed];
//    }];
//
//}
//#pragma mark - Table view data source
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//    return 1;
//}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//
//    return 5;
//}
//// 返回组头部view的高度
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
//
//    return 230 * px;
//
//}
//
//
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
//
//    if (indexPath.row == 0) {
//        return 400 * px;
//    }else if (indexPath.row == 3){
//        return 470 * px;
//    }else{
//        return 300 * px;
//    }
//}
////返回每组头部view
//
//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
//
//    UIView *headerView = [[UIView alloc]init];
//
//    headerView.backgroundColor = WYCRGBColor(20, 33, 48);
//
//    //标题
//    UILabel * Titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(30 * px, 30 * px, ScreenWidth, 60 * px)];
//    Titlelabel.textColor = [UIColor grayColor];
//    Titlelabel.text = [NSString stringWithFormat:@"%@",self.statisticalTime];
//    Titlelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(26 / 2)];
//    [headerView addSubview:Titlelabel];
//
//    //时间图片
//    UIImageView *TimeIMG = [[UIImageView alloc] initWithFrame:CGRectMake(Titlelabel.x, CGRectGetMaxY(Titlelabel.frame) + 20 * px, 50 * px, 50 * px)];
//    TimeIMG.image = [UIImage imageNamed:@"gxxj_icon"];
//    [headerView addSubview:TimeIMG];
//
//
//
//
//    //时间
//    UILabel * Timelabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(TimeIMG.frame) + 10 * px, TimeIMG.y, 350 * px, 50 * px)];
//    Timelabel.textColor = WYCRGBColor(139, 149, 171);
//    Timelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(26 / 2)];
//    Timelabel.text = [NSString stringWithFormat:@"%@",self.updateTime];;
//    [headerView addSubview:Timelabel];
//
//
//    return headerView;
//
//}
//
//
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//
//
//    MSHomeCell * cell = [MSHomeCell cellWithTableView:tableView];
//    tableView.backgroundColor = [UIColor clearColor];
//    //无色
//    cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//
//    cell.contentView.backgroundColor = WYCRGBColor(20, 33, 48);
//    if (indexPath.row == 0) {
//        UIView *CellView = [[UIView alloc]init];
//        CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 400 * px);
//        CellView.backgroundColor = WYCRGBColor(45, 54, 70);
//        //            CellView.cornerRadius = 20 * px;
//        // 左上和右上为圆角
//
//        UIBezierPath *cornerRadiusPath = [UIBezierPath bezierPathWithRoundedRect:CellView.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(20 * px, 20 * px)];
//        CAShapeLayer *cornerRadiusLayer = [ [CAShapeLayer alloc ] init];
//        cornerRadiusLayer.frame = CellView.bounds;
//        cornerRadiusLayer.path = cornerRadiusPath.CGPath;
//        CellView.layer.mask = cornerRadiusLayer;
//        [cell.contentView addSubview:CellView];
//
//
//        UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
//        line.backgroundColor = WYCRGBColor(55, 63, 84);
//        [CellView addSubview:line];
//
//        UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
//        photoIMG.image = [UIImage imageNamed:@"syze_icon"];
//        [CellView addSubview:photoIMG];
//
//
//
//        UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
//        CellTitleLabel.text = @"收益总额";
//        CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
//        CellTitleLabel.textColor = [UIColor whiteColor];
//        [CellView addSubview:CellTitleLabel];
//
//
//
//        UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, ScreenWidth * 0.8, 70 * px)];
//        TotalLabel.text = [NSString stringWithFormat:@"￥%@",self.totalIncome];
//        TotalLabel.font = [UIFont systemFontOfSize:SYRealValue(64 / 2)];;
//        TotalLabel.textColor = FontColor;
//        [CellView addSubview:TotalLabel];
//
//
//        UILabel * CashLabel = [[UILabel alloc] initWithFrame:CGRectMake(TotalLabel.x, CGRectGetMaxY(TotalLabel.frame) + 30 * px, CellView.width * 0.3, 50 * px)];
//        CashLabel.text = [NSString stringWithFormat:@"现金:%@",self.cashPay];
//        CashLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
//        CashLabel.textColor = WYCRGBColor(141,153,178);
//        [CellView addSubview:CashLabel];
//
//
//        UILabel * WxchatLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CashLabel.frame) + 30 * px, CashLabel.y, CashLabel.width, CashLabel.height)];
//        WxchatLabel.text = [NSString stringWithFormat:@"微信:%@",self.weChat];
//        WxchatLabel.font = CashLabel.font;
//        WxchatLabel.textColor = CashLabel.textColor;
//        [CellView addSubview:WxchatLabel];
//
//
//        UILabel * PayCardLabel = [[UILabel alloc] initWithFrame:CGRectMake(CashLabel.x, CGRectGetMaxY(CashLabel.frame) + 30 * px, CashLabel.width, CashLabel.height)];
//        PayCardLabel.text = [NSString stringWithFormat:@"刷卡:%@",self.bankCardPay];
//        PayCardLabel.font = CashLabel.font;
//        PayCardLabel.textColor = CashLabel.textColor;
//        [CellView addSubview:PayCardLabel];
//
//
//        UILabel * AlipayLabel = [[UILabel alloc] initWithFrame:CGRectMake(WxchatLabel.x, PayCardLabel.y, CashLabel.width, CashLabel.height)];
//        AlipayLabel.text = [NSString stringWithFormat:@"支付宝:%@",self.aliPay];
//        AlipayLabel.font = CashLabel.font;
//        AlipayLabel.textColor = CashLabel.textColor;
//        [CellView addSubview:AlipayLabel];
//    }else if (indexPath.row == 1){
//
//        UIView *CellView = [[UIView alloc]init];
//        CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
//        CellView.backgroundColor = WYCRGBColor(45, 54, 70);
//        [cell.contentView addSubview:CellView];
//
//
//        UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
//        line.backgroundColor = WYCRGBColor(55, 63, 84);
//        [CellView addSubview:line];
//
//        UIImageView * VipIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
//        VipIMG.image = [UIImage imageNamed:@"hyk_icon"];
//        [CellView addSubview:VipIMG];
//
//
//
//        UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(VipIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
//        CellTitleLabel.text = @"会员卡";
//        CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
//        CellTitleLabel.textColor = [UIColor whiteColor];
//        [CellView addSubview:CellTitleLabel];
//
//
//
//        UILabel * RechargeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, 600 * px, 50 * px)];
//        RechargeLabel.text = [NSString stringWithFormat:@"充值入账:%@",self.memberCardMoney];
//        RechargeLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
//        RechargeLabel.textColor = WYCRGBColor(141,153,178);
//        [CellView addSubview:RechargeLabel];
//
//
//        UILabel * ConsumptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(RechargeLabel.frame) + 30 * px, RechargeLabel.width, RechargeLabel.height)];
//        ConsumptionLabel.text = [NSString stringWithFormat:@"消费入账:%@",self.membershipPay];
//        ConsumptionLabel.font = RechargeLabel.font;
//        ConsumptionLabel.textColor = RechargeLabel.textColor;
//        [CellView addSubview:ConsumptionLabel];
//    }else if (indexPath.row == 2){
//
//        UIView *CellView = [[UIView alloc]init];
//        CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
//        CellView.backgroundColor = WYCRGBColor(45, 54, 70);
//        [cell.contentView addSubview:CellView];
//
//
//        UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
//        line.backgroundColor = WYCRGBColor(55, 63, 84);
//        [CellView addSubview:line];
//
//        UIImageView * VipIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
//        VipIMG.image = [UIImage imageNamed:@"gzsj_icon"];
//        [CellView addSubview:VipIMG];
//
//
//
//        UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(VipIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
//        CellTitleLabel.text = @"挂账数据";
//        CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
//        CellTitleLabel.textColor = [UIColor whiteColor];
//        [CellView addSubview:CellTitleLabel];
//
//
//
//        UILabel * RepaymentLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, 600 * px, 50 * px)];
//        RepaymentLabel.text = [NSString stringWithFormat:@"今日挂账还款:%@",self.repaymentMoney];
//        RepaymentLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
//        RepaymentLabel.textColor = WYCRGBColor(141,153,178);
//        [CellView addSubview:RepaymentLabel];
//
//
//        UILabel * RepaymentamountLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(RepaymentLabel.frame) + 30 * px, RepaymentLabel.width, RepaymentLabel.height)];
//        RepaymentamountLabel.text = [NSString stringWithFormat:@"今日挂账额:%@",self.accountingMoney];
//        RepaymentamountLabel.font = RepaymentLabel.font;
//        RepaymentamountLabel.textColor = RepaymentLabel.textColor;
//        [CellView addSubview:RepaymentamountLabel];
//
//    }else if (indexPath.row == 3) {
//        UIView *CellView = [[UIView alloc]init];
//        CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 470 * px);
//        CellView.backgroundColor = WYCRGBColor(45, 54, 70);
//        [cell.contentView addSubview:CellView];
//
//
//        UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
//        line.backgroundColor = WYCRGBColor(55, 63, 84);
//        [CellView addSubview:line];
//
//        UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
//        photoIMG.image = [UIImage imageNamed:@"qtsy_icon"];
//        [CellView addSubview:photoIMG];
//
//
//
//        UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, 30 * px, 360 * px, 60 * px)];
//        CellTitleLabel.text = @"其他收益额";
//        CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
//        CellTitleLabel.textColor = [UIColor whiteColor];
//        [CellView addSubview:CellTitleLabel];
//
//
//
//        UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, ScreenWidth * 0.8, 70 * px)];
//        TotalLabel.text = [NSString stringWithFormat:@"￥%@",self.otherMoney];
//        TotalLabel.font = [UIFont boldSystemFontOfSize:SYRealValue(64 / 2)];
//        TotalLabel.textColor = FontColor;
//        [CellView addSubview:TotalLabel];
//
//
//        UILabel * CashLabel = [[UILabel alloc] initWithFrame:CGRectMake(TotalLabel.x, CGRectGetMaxY(TotalLabel.frame) + 30 * px, CellView.width * 0.3, 50 * px)];
//        CashLabel.text = [NSString stringWithFormat:@"现金:%@",self.othercashPay];
//        CashLabel.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
//        CashLabel.textColor = WYCRGBColor(141,153,178);
//        [CellView addSubview:CashLabel];
//
//
//        UILabel * WxchatLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CashLabel.frame) + 30 * px, CashLabel.y, CashLabel.width, CashLabel.height)];
//        WxchatLabel.text = [NSString stringWithFormat:@"微信:%@",self.otherweChat];
//        WxchatLabel.font = CashLabel.font;
//        WxchatLabel.textColor = CashLabel.textColor;
//        [CellView addSubview:WxchatLabel];
//
//
//        UILabel * shuakaLabel = [[UILabel alloc] initWithFrame:CGRectMake(CashLabel.x, CGRectGetMaxY(CashLabel.frame) + 30 * px, CashLabel.width , CashLabel.height)];
//        shuakaLabel.text = [NSString stringWithFormat:@"刷卡:%@",self.otherbankCardPay];
//        shuakaLabel.font = CashLabel.font;
//        shuakaLabel.textColor = CashLabel.textColor;
//        [CellView addSubview:shuakaLabel];
//
//
//        UILabel * ZhifubaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(WxchatLabel.x, shuakaLabel.y, CashLabel.width, CashLabel.height)];
//        ZhifubaoLabel.text = [NSString stringWithFormat:@"支付宝:%@",self.otheraliPay];
//        ZhifubaoLabel.font = CashLabel.font;
//        ZhifubaoLabel.textColor = CashLabel.textColor;
//        [CellView addSubview:ZhifubaoLabel];
//
//        UILabel * HuiyuankaLabel = [[UILabel alloc] initWithFrame:CGRectMake(shuakaLabel.x, CGRectGetMaxY(shuakaLabel.frame) + 30 * px, shuakaLabel.width, shuakaLabel.height)];
//        HuiyuankaLabel.text = [NSString stringWithFormat:@"会员卡支付:%@",self.otherMembershipMoney];
//        HuiyuankaLabel.font = CashLabel.font;
//        HuiyuankaLabel.textColor = CashLabel.textColor;
//        [CellView addSubview:HuiyuankaLabel];
//
//
//    }else{
//        UIView *CellView = [[UIView alloc]init];
//        CellView.frame = CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 300 * px);
//        CellView.backgroundColor = BackViewColor;
//
//
//        UIBezierPath *cornerRadiusPath = [UIBezierPath bezierPathWithRoundedRect:CellView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(20 * px, 20 * px)];
//        CAShapeLayer *cornerRadiusLayer = [ [CAShapeLayer alloc ] init];
//        cornerRadiusLayer.frame = CellView.bounds;
//        cornerRadiusLayer.path = cornerRadiusPath.CGPath;
//        CellView.layer.mask = cornerRadiusLayer;
//        [cell.contentView addSubview:CellView];
//
//
//        UIView * line = [[UIView alloc] initWithFrame:CGRectMake(0, CellView.height - 0.5, CellView.width, 0.5)];
//        line.backgroundColor = WYCRGBColor(55, 63, 84);
//        [CellView addSubview:line];
//
//        UIImageView * photoIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 80 * px, 80 * px, 80 * px)];
//        photoIMG.image = [UIImage imageNamed:@"zdfy_icon"];
//        [CellView addSubview:photoIMG];
//
//
//
//        UILabel * CellTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(photoIMG.frame) + 30 * px, 30 * px, 260 * px, 60 * px)];
//        CellTitleLabel.text = @"招待费用";
//        CellTitleLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
//        CellTitleLabel.textColor = [UIColor whiteColor];
//        [CellView addSubview:CellTitleLabel];
//
//
//
//        UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(CellTitleLabel.x, CGRectGetMaxY(CellTitleLabel.frame) + 30 * px, ScreenWidth * 0.8, 70 * px)];
//        TotalLabel.text = [NSString stringWithFormat:@"¥%@",self.rewardMoney];
//        TotalLabel.font = [UIFont systemFontOfSize:SYRealValue(64 / 2)];
//        TotalLabel.textColor = WYCRGBColor(41,147,242);
//        [CellView addSubview:TotalLabel];
//
//
//    }
//    return cell;
//}
//
#import "MSWeekReportFormController.h"
#import "MSHomeCell.h"
#import "YzcChartView.h"
#import "YzcBarChart.h"
#import "LRSChartView.h"
#import "LYCircleView.h"
#import "JHColumnChart.h"
#import "LYSLineChart.h"
#import "LYSHistogramChart.h"
#import "MSBusinessReportformModel.h"
#import "JHChartHeader.h"
#import "LFLineChart.h"
#import "MSDayTimeView.h"
#import "HQPickerView.h"

@interface MSWeekReportFormController ()<UITableViewDataSource,UITableViewDelegate,LYCircleViewDataSource,HQPickerViewDelegate>{
    LYCircleView *circle;
}
/** 表视图*/
@property(nonatomic,strong)UITableView *tableView;
@property (nonatomic, strong) LRSChartView *incomeChartLineView;

@property (nonatomic, strong) LFLineChart *lineChart;


/** 总收益额*/
@property(nonatomic,strong)NSString *totalIncome;




/** 充值*/
@property(nonatomic,strong)NSString *membershipPay;

/** 充值*/
@property(nonatomic,strong)NSString *memberCardMoney;


/** 挂账*/
@property(nonatomic,strong)NSString *repaymentMoney;

/** 挂账*/
@property(nonatomic,strong)NSString *accountingMoney;

/** 其他*/
@property(nonatomic,strong)NSString *otherMoney;

/** 打赏*/
@property(nonatomic,strong)NSString *rewardMoney;



/** 会员卡消费曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeRechargeMapArray;

/** 会员卡消费曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeRechargeMapTimeArray;



/** 会员卡充值曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeConsumptionMapArray;

/** 会员卡充值曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeConsumptionMapTimeArray;



/** 挂账还款曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeRepaymentMapArray;

/** 挂账还款曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeRepaymentMapTimeArray;


/** 挂账还款曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeAccountingMapArray;

/** 挂账还款曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeAccountingMapTimeArray;


/** 其他收入曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeOtherMoneyMapArray;


/** 打赏收入曲线图*/
@property(nonatomic,strong)NSMutableArray *incomeRewardMapArray;


/** <#name#>*/
@property(nonatomic,strong)UILabel *timeLabel;

/** <#name#>*/
@property(nonatomic,strong)NSString * TimeStr;

@end

@implementation MSWeekReportFormController

- (int)navBarBottom {
    if ([WRNavigationBar isIphoneX]) {
        return 88;
    } else {
        return 64;
    }
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
    self.punchCountMapArray = [NSMutableArray new];
   
    
    
    self.incomeConsumptionMapArray = [NSMutableArray new];
    self.incomeConsumptionMapTimeArray = [NSMutableArray new];
    self.incomeRechargeMapArray = [NSMutableArray new];
    self.incomeRechargeMapTimeArray = [NSMutableArray new];
    
    self.incomeRepaymentMapArray = [NSMutableArray new];
    self.incomeRepaymentMapTimeArray = [NSMutableArray new];
    self.incomeAccountingMapArray = [NSMutableArray new];
    self.incomeAccountingMapTimeArray = [NSMutableArray new];
    
    
    self.incomeOtherMoneyMapArray = [NSMutableArray new];
    self.incomeRewardMapArray = [NSMutableArray new];
    
    Prepare *header = [Prepare headerWithRefreshingTarget:self refreshingAction:@selector(MJChiBaoZiHeaderRefresh)];
    // 隐藏时间
    header.lastUpdatedTimeLabel.hidden = YES;
    header.stateLabel.hidden = YES;
    // 马上进入刷新状态
    self.tableView.mj_header = header;
    [self.tableView.mj_header beginRefreshing];
    //    [self ReloadData];
}
- (void)MJChiBaoZiHeaderRefresh{
    //    [self.tableView.header beginRefreshing];
    //    [self loadShowproduct];
    [self ReloadData];
    
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:YES];
    self.navigationController.navigationBar.hidden = YES;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
     self.punchCountMapTimeArray = [NSMutableArray new];
    [self tableView];
    
    [self CreatView];
    
    self.view.backgroundColor = WYCRGBColor(20, 33, 48);
}
- (void)CreatView{
    UIView * HeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 200 * px)];
    HeaderView.backgroundColor = backgroundcolor;
    [self.view addSubview:HeaderView];
    
    UIView * timeView = [[UIView alloc] initWithFrame:CGRectMake(ScreenWidth / 8, 50 * px, ScreenWidth  * 0.6, 100 * px)];
    timeView.layer.cornerRadius = 10 * px;
    timeView.layer.borderWidth = 1;
    timeView.layer.borderColor = WYCRGBColor(33, 46, 45).CGColor;
    [HeaderView addSubview:timeView];
    
    
    /** 日历图标*/
    UIButton * TimeButton = [[UIButton alloc] initWithFrame:CGRectMake(40 * px, 20 * px, 60 * px, 60 * px)];
    //    [TimeButton setImage:[UIImage imageNamed:@"calendar icon"] forState:UIControlStateNormal];
    [TimeButton setBackgroundImage:[UIImage imageNamed:@"calendar icon"] forState:UIControlStateNormal];
    TimeButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
    //    TimeButton.backgroundColor = [UIColor redColor];
    [TimeButton addTarget:self action:@selector(showPickerView) forControlEvents:UIControlEventTouchUpInside];
    [timeView addSubview:TimeButton];
    
    /**  周*/
    UILabel * WeekLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(TimeButton.frame) + 30 * px, TimeButton.y, TimeButton.width, TimeButton.height)];
    WeekLabel.textColor = [UIColor grayColor];
    WeekLabel.text = @"周";
    WeekLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [timeView addSubview:WeekLabel];
    
    /** 左按钮*/
    UIButton *  leftButton= [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(WeekLabel.frame) + 20 * px, TimeButton.y, 40 * px, TimeButton.height)];
    [leftButton setBackgroundImage:[UIImage imageNamed:@"日期选择-左箭头"] forState:UIControlStateNormal];
    //    [leftButton addTarget:self action:@selector(leftButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [timeView addSubview:leftButton];
    
    NSDate*date = [NSDate date];
    
    
    NSCalendar*calendar = [NSCalendar currentCalendar];
    
    
    NSDateComponents*comps;
    
    comps =[calendar components:(NSWeekCalendarUnit | NSWeekdayCalendarUnit |NSWeekdayOrdinalCalendarUnit)
            
            
                       fromDate:date];
    
    NSInteger year = [comps year];
    
    NSInteger week = [comps week]; // 今年的第几周
    
    
    NSInteger weekday = [comps weekday]; // 星期几（注意，周日是“1”，周一是“2”。。。。）
    
    
    NSInteger weekdayOrdinal = [comps weekdayOrdinal]; // 这个月的第几周
    
    
    //    NSLog(@"week:%d weekday: %d weekday ordinal: %d", week, weekday, weekdayOrdinal);
    
    /** 时间*/
    UILabel * timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(leftButton.frame) + 40 * px, TimeButton.y, 250 * px, TimeButton.height)];
    timeLabel.textColor = [UIColor grayColor];
    timeLabel.textAlignment = NSTextAlignmentCenter;
    timeLabel.text = [NSString stringWithFormat:@"第%ld周",(long)weekdayOrdinal];
    timeLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
    [timeView addSubview:timeLabel];
    self.timeLabel = timeLabel;
    
    /** 右按钮*/
    UIButton *  rightButton= [[UIButton alloc] initWithFrame:CGRectMake(CGRectGetMaxX(timeLabel.frame) + 20 * px, TimeButton.y, leftButton.width, TimeButton.height)];
    [rightButton setBackgroundImage:[UIImage imageNamed:@"日期选择-右箭头"] forState:UIControlStateNormal];
    //    [rightButton addTarget:self action:@selector(leftButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [timeView addSubview:rightButton];
    
    self.tableView.tableHeaderView = HeaderView;
    
}

- (void)ReloadData{
    
    [self.punchCountMapArray removeAllObjects];
    [self.punchCountMapTimeArray removeAllObjects];
    
    
    [self.incomeConsumptionMapArray removeAllObjects];
    [self.incomeConsumptionMapTimeArray removeAllObjects];
    [self.incomeRechargeMapArray removeAllObjects];
    [self.incomeRechargeMapTimeArray removeAllObjects];
    
    
    [self.incomeRepaymentMapArray removeAllObjects];
    [self.incomeRepaymentMapTimeArray removeAllObjects];
    
    
    [self.incomeAccountingMapArray removeAllObjects];
    [self.incomeAccountingMapTimeArray removeAllObjects];
    
    
    [self.incomeOtherMoneyMapArray removeAllObjects];
    [self.incomeRewardMapArray removeAllObjects];
    if ([self.timeLabel.text isEqualToString:@"第1周"]) {
        self.TimeStr = @"1";
    }else if ([self.timeLabel.text isEqualToString:@"第2周"]) {
        self.TimeStr = @"2";
    }else if ([self.timeLabel.text isEqualToString:@"第3周"]) {
        self.TimeStr = @"3";
    }else if ([self.timeLabel.text isEqualToString:@"第4周"]) {
        self.TimeStr = @"4";
    }else{
        self.TimeStr = @"5";
    }
    
    NSDictionary * params = @{@"busId":[WYCAccountTool unarchivebelongBusid],@"queryTime":@"week",@"Time":self.TimeStr};
    [HTTPRequest POST:MSgetBussinessIncome params:params succeed:^(id responseObject) {
        WYCLog(@"responseObject--------------%@",responseObject);
        WYCLog(@"--------------%@",params);
        if (CodeStr) {
            [self.tableView.mj_header endRefreshing];
            
            //总收益额
            self.totalIncome = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"totalIncome"]];

            
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"punchCountMap"]) {
//<<<<<<< HEAD
//                WYCLog(@"11111--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
//                NSString *queryTimeStr =
                NSString *countString = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                
                NSString *sumMoneyString = [[NSString alloc]initWithFormat:@"%@",model.sumMoney];
                NSDictionary *dic = @{@"item":countString,@"count":sumMoneyString};
                [self.punchCountMapTimeArray addObject:dic];
            }
            
            //其他
            self.otherMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"otherIncomeAll"][@"otherMoney"]];
            for (NSDictionary * dict in responseObject[@"data"][@"otherIncomeAll"][@"incomeOtherMoneyMap"]) {
                //                WYCLog(@"11111--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                //                NSString *queryTimeStr =
                NSString *countString = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                
                NSString *sumMoneyString = [[NSString alloc]initWithFormat:@"%@",model.sumMoney];
                NSDictionary *dic = @{@"item":countString,@"count":sumMoneyString};
                [self.incomeOtherMoneyMapArray addObject:dic];
            }
            
            
            //打赏
            self.rewardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"rewardIncomeAll"][@"rewardMoney"]];
            for (NSDictionary * dict in responseObject[@"data"][@"rewardIncomeAll"][@"incomeRewardMap"]) {
                //                WYCLog(@"11111--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                //                NSString *queryTimeStr =
                NSString *countString = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                
                NSString *sumMoneyString = [[NSString alloc]initWithFormat:@"%@",model.sumMoney];
                NSDictionary *dic = @{@"item":countString,@"count":sumMoneyString};
                [self.incomeRewardMapArray addObject:dic];
            }
            
            
            //会员卡充值
            self.membershipPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"membershipPay"]];
            
            self.memberCardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"memberCardMoney"]];
            
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeRechargeMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeRechargeMapTimeArray addObject:queryTimeStr];
                
                [self.incomeRechargeMapArray addObject:model.sumMoney];
            }
            
            //会员卡消费
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeConsumptionMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeConsumptionMapTimeArray addObject:queryTimeStr];
                
                [self.incomeConsumptionMapArray addObject:model.sumMoney];
            }
            
            
            
            //挂账
            self.repaymentMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"repaymentMoney"]];
            
            self.accountingMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"accountingMoney"]];
            
            //挂账还款曲线图
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeRepaymentMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeRepaymentMapTimeArray addObject:queryTimeStr];
                
                [self.incomeRepaymentMapArray addObject:model.sumMoney];
            }
            
             //挂账额曲线图
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeAccountingMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeAccountingMapTimeArray addObject:queryTimeStr];
                
                [self.incomeAccountingMapArray addObject:model.sumMoney];

            }
//            //会员卡
            self.membershipPay = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"membershipPay"]];
            
            self.memberCardMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"memberCardMoney"]];
            
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeRechargeMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeRechargeMapTimeArray addObject:queryTimeStr];
                
                [self.incomeRechargeMapArray addObject:model.sumMoney];
            }
            
            
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeConsumptionMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeConsumptionMapTimeArray addObject:queryTimeStr];
                
                [self.incomeConsumptionMapArray addObject:model.sumMoney];
            }
            //挂账
            self.repaymentMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"repaymentMoney"]];
            
            self.accountingMoney = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"incomeAll"][@"accountingMoney"]];
            
            
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeRepaymentMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeRepaymentMapTimeArray addObject:queryTimeStr];
                
                [self.incomeRepaymentMapArray addObject:model.sumMoney];
            }
            
            
            for (NSDictionary * dict in responseObject[@"data"][@"incomeAll"][@"incomeAccountingMap"]) {
                //                WYCLog(@"--------------%@",responseObject[@"incomeAll"][@"punchCountMap"]);
                MSBusinessReportformModel * model = [MSBusinessReportformModel mj_objectWithKeyValues:dict];
                //3.分隔字符串
                NSString *string = [NSString stringWithFormat:@"%@",model.queryTime];
                
                NSArray *array = [string componentsSeparatedByString:@"-"]; //从字符A中分隔成2个元素的数组
                
                NSString *queryTimeStr = [NSString stringWithFormat:@"%@.%@",array[1],array[2]];
                [self.incomeAccountingMapTimeArray addObject:queryTimeStr];
                
                [self.incomeAccountingMapArray addObject:model.sumMoney];
            }
            
        }else{
            [self.tableView.mj_header endRefreshing];
            [MBManager showBriefAlert:responseObject[@"msg"]];
        }
        
        [self.tableView reloadData];
    } failure:^(NSError *error) {
        
    }];
}

- (void)showPickerView {
    
    NSCalendar *calendar = [NSCalendar currentCalendar];
    
    NSRange range = [calendar rangeOfUnit:NSDayCalendarUnit inUnit:NSMonthCalendarUnit forDate:[NSDate date]];
    
    NSUInteger numberOfDaysInMonth = range.length;
    
    //    NSLog(@"%lu", (unsigned long)numberOfDaysInMonth);
    HQPickerView *picker = [[HQPickerView alloc]initWithFrame:self.view.bounds];
    picker.delegate = self ;
    
    float dayF = numberOfDaysInMonth / 7;
    WYCLog(@"-=-------%f",dayF);
    //    CGFloat *
    if (dayF >= 4.0f) {
        picker.customArr = @[@"第1周",@"第2周",@"第3周",@"第4周",@"第5周"];
    }
    else{
        picker.customArr = @[@"第1周",@"第2周",@"第3周",@"第4周"];
    }
    
    [[UIApplication sharedApplication].keyWindow addSubview:picker];
}

- (void)pickerView:(UIPickerView *)pickerView didSelectText:(NSString *)text didSelectStr:(NSString *)ID{
    self.timeLabel.text = [NSString stringWithFormat:@"%@",text];
    [self ReloadData];
}

/** 表视图*/
- (UITableView *)tableView{
    self.extendedLayoutIncludesOpaqueBars = YES;
    if (!_tableView) {
        
        if (@available(iOS 11.0, *)) {
            
            _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
            
        } else {
            
            self.automaticallyAdjustsScrollViewInsets = NO;
            
        }
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - [self navBarBottom] - 100 * px) style:UITableViewStyleGrouped];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.backgroundColor = [UIColor clearColor];
        _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        [self.view addSubview:self.tableView];
    }
    return _tableView;
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 5;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 1;
}
// 返回组头部view的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 130 * px;
    
}

//返回每组头部view

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    
    UIView *headerView = [[UIView alloc]init];
    
    headerView.backgroundColor = WYCRGBColor(20, 33, 48);
    
    
    //图片
    UIImageView *CheckIMG = [[UIImageView alloc] initWithFrame:CGRectMake(60 * px, 45 * px, 40 * px, 40 * px)];
    [headerView addSubview:CheckIMG];
    
    
    //标题
    UILabel * Titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(CheckIMG.frame) + 10 * px, 35 * px, 230 * px, 60 * px)];
    Titlelabel.textColor = WYCRGBColor(107, 127, 151);
    Titlelabel.font = [UIFont boldSystemFontOfSize:SYRealValue(30 / 2)];
    [headerView addSubview:Titlelabel];
    
    
    
    if (section == 0) {
        
        CheckIMG.image = [UIImage imageNamed:@"syzesmall_icon"];
        Titlelabel.text = @"收益总额";
        
    }else if (section == 1) {
        
        CheckIMG.image = [UIImage imageNamed:@"vipsmall_icon"];
        Titlelabel.text = @"会员卡";
        
    }else if (section == 2) {
        CheckIMG.image = [UIImage imageNamed:@"gzsjmall_icon"];
        Titlelabel.text = @"挂账数据";
        
    }else if (section == 3) {
        CheckIMG.image = [UIImage imageNamed:@"qtsksmall_icon"];
        Titlelabel.text = @"其他收款";
        
    }else {
        CheckIMG.image = [UIImage imageNamed:@"zdfysmall_icon"];
        Titlelabel.text = @"招待费用";
        
    }
    
    return headerView;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0) {
        return 870 * px;
    }else if (indexPath.section == 1) {
        return 900 * px;
    }else if (indexPath.section == 2) {
        return 900 * px;
    }else if (indexPath.section == 3) {
        return 870 * px;
    }else{
        return 900 * px;
    }
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    MSHomeCell * cell = [MSHomeCell cellWithTableView:tableView];
    tableView.backgroundColor = [UIColor clearColor];
    //无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    if (indexPath.section == 0) {
        /** 背景*/
        UIView * OneView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 230 * px)];
        OneView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:OneView];
        
        
        /** 总额*/
        UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, 30 * px, ScreenWidth * 0.5, 60 * px)];
        TotalLabel.textColor = [UIColor whiteColor];
        TotalLabel.text = [NSString stringWithFormat:@"￥%@",self.totalIncome];
        TotalLabel.textAlignment = NSTextAlignmentLeft;
        TotalLabel.font = [UIFont systemFontOfSize:SYRealValue(44 / 2)];
        [OneView addSubview:TotalLabel];
        
        
        /** 总额*/
        UILabel * TotalTitle = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, CGRectGetMaxY(TotalLabel.frame) + 20 * px, 100 * px, 50 * px)];
        TotalTitle.textColor = [UIColor blackColor];
        TotalTitle.backgroundColor = WYCRGBColor(95, 207, 185);
        TotalTitle.layer.cornerRadius = 10 * px;
        TotalTitle.text = @"总额";
        TotalTitle.textAlignment = NSTextAlignmentCenter;
        TotalTitle.font = [UIFont systemFontOfSize:SYRealValue(24 / 2)];
        [OneView addSubview:TotalTitle];
        
        
        UIView * TowView = [[UIView alloc] initWithFrame:CGRectMake(30 * px, CGRectGetMaxY(OneView.frame) + 20 * px, ScreenWidth - 60 * px, 600 * px)];
        TowView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:TowView];
        
        
        
        self.lineChart = [[LFLineChart alloc] initWithFrame:CGRectMake(0, 0,TowView.width, TowView.height)];
        self.lineChart.backgroundColor = [UIColor clearColor];
        // 设置折线图属性
        self.lineChart.title = @""; // 折线图名称
        NSMutableArray *orderedArray = [[NSMutableArray alloc]init];
        float max = 0;
        for(int i = 0; i < 8; i++){
            
            NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
            NSString *xValue;
            NSString *yValue;
            xValue = [NSString stringWithFormat:@"%d",i];

            yValue = [NSString stringWithFormat:@"%d",i];
            if ([yValue floatValue]>max) {
                max = [yValue floatValue];
            }
            dict = [@{
                      @"item": xValue, @"count":yValue
                      } mutableCopy];
            [orderedArray addObject:dict];
            
        }
      
        self.lineChart.maxValue = max;
        if (max == 0) {
            self.lineChart.maxValue = 1;
        }
        self.lineChart.xScaleMarkLEN = [UIScreen mainScreen].bounds.size.width / orderedArray.count;

        if (self.punchCountMapTimeArray.count > 0) {
            [self.lineChart setXMarkTitlesAndValues:self.punchCountMapTimeArray titleKey:@"item" valueKey:@"count"]; // X轴刻度标签及相应的值
        } else {
            [self.lineChart setXMarkTitlesAndValues:orderedArray titleKey:@"item" valueKey:@"count"]; // X轴刻度标签及相应的值
        }
//<<<<<<< HEAD
//=======
//
//>>>>>>> 16b81de0644e5e51275c4723efe4fb831777dd1a

        //设置完数据等属性后绘图折线图
        [self.lineChart mapping];
        [TowView addSubview:self.lineChart];
        //头顶上的时间标志
        UILabel * unitLabel = [[UILabel alloc]initWithFrame:CGRectMake(40 * px, 10 * px, 200 * px, 50 * px)];
        unitLabel.text = @"收益趋势";
        unitLabel.backgroundColor = backgroundcolor;
        unitLabel.layer.cornerRadius = 25 * px;
        unitLabel.layer.masksToBounds = YES;
        unitLabel.textColor = [UIColor whiteColor];
        unitLabel.textAlignment = NSTextAlignmentCenter;
        unitLabel.font = [UIFont systemFontOfSize:SYRealValue(20 / 2)];
        [TowView addSubview:unitLabel];
        
        
        

        
    }else if (indexPath.section == 1){
        
        /** 背景*/
        UIView * OneView = [[UIView alloc] initWithFrame:CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 900 * px)];
        OneView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:OneView];
        
        /** 总额*/
        UILabel * RechargeTitle = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, 30 * px, 200 * px, 50 * px)];
        RechargeTitle.textColor = [UIColor whiteColor];
        RechargeTitle.backgroundColor = WYCRGBColor(61, 93, 185);
        RechargeTitle.layer.cornerRadius = 25 * px;
        RechargeTitle.layer.masksToBounds = YES;
        RechargeTitle.text = @"充值入账";
        RechargeTitle.textAlignment = NSTextAlignmentCenter;
        RechargeTitle.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
        [OneView addSubview:RechargeTitle];
        
        
        /** 总额*/
        UILabel * RechargeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(RechargeTitle.frame) + 30 * px, RechargeTitle.y, ScreenWidth * 0.5, 60 * px)];
        RechargeLabel.textColor = [UIColor whiteColor];
        RechargeLabel.text = [NSString stringWithFormat:@"￥%@",self.membershipPay];
        RechargeLabel.textAlignment = NSTextAlignmentLeft;
        RechargeLabel.font = [UIFont systemFontOfSize:SYRealValue(35 / 2)];
        [OneView addSubview:RechargeLabel];
        
        
        /** 总额*/
        UILabel * ConsumptionTitle = [[UILabel alloc] initWithFrame:CGRectMake(RechargeTitle.x, CGRectGetMaxY(RechargeTitle.frame) + 30 * px, RechargeTitle.width, RechargeTitle.height)];
        ConsumptionTitle.textColor = [UIColor whiteColor];
        ConsumptionTitle.backgroundColor = WYCRGBColor(95, 207, 185);
        ConsumptionTitle.layer.cornerRadius = RechargeTitle.layer.cornerRadius;
        ConsumptionTitle.text = @"消费入账";
        ConsumptionTitle.layer.masksToBounds = YES;
        ConsumptionTitle.textAlignment = NSTextAlignmentCenter;
        ConsumptionTitle.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
        [OneView addSubview:ConsumptionTitle];
        
        
        /** 总额*/
        UILabel * ConsumptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(RechargeLabel.x, ConsumptionTitle.y, RechargeLabel.width, RechargeLabel.height)];
        ConsumptionLabel.textColor = [UIColor whiteColor];
        ConsumptionLabel.text = [NSString stringWithFormat:@"￥%@",self.memberCardMoney];
        ConsumptionLabel.textAlignment = NSTextAlignmentLeft;
        ConsumptionLabel.font = RechargeLabel.font;
        [OneView addSubview:ConsumptionLabel];
        
        
        
        
        
        JHLineChart *lineChart = [[JHLineChart alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(ConsumptionTitle.frame) + 30 * px, OneView.width, OneView.height - 190 * px) andLineChartType:JHChartLineValueNotForEveryX];
        
        /* X轴的刻度值 可以传入NSString或NSNumber类型  并且数据结构随折线图类型变化而变化 详情看文档或其他象限X轴数据源示例*/
        lineChart.xLineDataArr = self.incomeConsumptionMapTimeArray;
        
        /* 折线图的不同类型  按照象限划分 不同象限对应不同X轴刻度数据源和不同的值数据源 */
        lineChart.lineChartQuadrantType = JHLineChartQuadrantTypeFirstQuardrant;
        
        /* 数据源 */
        lineChart.valueArr = @[self.incomeConsumptionMapArray,self.incomeRechargeMapArray];
        
        /* 值折线的折线颜色 默认暗黑色*/
        lineChart.valueLineColorArr =@[WYCRGBColor(61, 93, 184), WYCRGBColor(86, 176, 193)];
        
        
        lineChart.backgroundColor = [UIColor clearColor];
        /* 值点的颜色 默认橘黄色*/
        lineChart.pointColorArr = @[WYCRGBColor(61, 93, 184),WYCRGBColor(86, 176, 193)];
        
        /* X和Y轴的颜色 默认暗黑色 */
        lineChart.xAndYLineColor = [UIColor clearColor];
        
        /* XY轴的刻度颜色 m */
        lineChart.xAndYNumberColor = [UIColor whiteColor];
        
        /* 坐标点的虚线颜色 */
        lineChart.positionLineColorArr = @[[UIColor clearColor],[UIColor clearColor]];
        [OneView addSubview:lineChart];
        [lineChart showAnimation];
        
        
        
        
    }else if (indexPath.section == 2){
        
        /** 背景*/
        UIView * OneView = [[UIView alloc] initWithFrame:CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 900 * px)];
        OneView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:OneView];
        
        
        
        
        
        /** 总额*/
        UILabel * RechargeTitle = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, 30 * px, 200 * px, 50 * px)];
        RechargeTitle.textColor = [UIColor whiteColor];
        RechargeTitle.backgroundColor = WYCRGBColor(61, 93, 185);
        RechargeTitle.layer.cornerRadius = 25 * px;
        RechargeTitle.layer.masksToBounds = YES;
        RechargeTitle.text = @"挂账还款";
        RechargeTitle.textAlignment = NSTextAlignmentCenter;
        RechargeTitle.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
        [OneView addSubview:RechargeTitle];
        
        
        /** 总额*/
        UILabel * RechargeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(RechargeTitle.frame) + 30 * px, RechargeTitle.y, ScreenWidth * 0.5, 60 * px)];
        RechargeLabel.textColor = [UIColor whiteColor];
        RechargeLabel.text = [NSString stringWithFormat:@"￥%@",self.repaymentMoney];
        RechargeLabel.textAlignment = NSTextAlignmentLeft;
        RechargeLabel.font = [UIFont systemFontOfSize:SYRealValue(35 / 2)];
        [OneView addSubview:RechargeLabel];
        
        
        /** 总额*/
        UILabel * ConsumptionTitle = [[UILabel alloc] initWithFrame:CGRectMake(RechargeTitle.x, CGRectGetMaxY(RechargeTitle.frame) + 30 * px, RechargeTitle.width, RechargeTitle.height)];
        ConsumptionTitle.textColor = [UIColor whiteColor];
        ConsumptionTitle.backgroundColor = FontColor;
        ConsumptionTitle.layer.cornerRadius = RechargeTitle.layer.cornerRadius;
        ConsumptionTitle.text = @"挂账额";
        ConsumptionTitle.layer.masksToBounds = YES;
        ConsumptionTitle.textAlignment = NSTextAlignmentCenter;
        ConsumptionTitle.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
        [OneView addSubview:ConsumptionTitle];
        
        
        /** 总额*/
        UILabel * ConsumptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(RechargeLabel.x, ConsumptionTitle.y, RechargeLabel.width, RechargeLabel.height)];
        ConsumptionLabel.textColor = [UIColor whiteColor];
        ConsumptionLabel.text = [NSString stringWithFormat:@"￥%@",self.accountingMoney];
        ConsumptionLabel.textAlignment = NSTextAlignmentLeft;
        ConsumptionLabel.font = RechargeLabel.font;
        [OneView addSubview:ConsumptionLabel];
        
        
        
        
        
        JHLineChart *lineChart = [[JHLineChart alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(ConsumptionTitle.frame) + 30 * px, OneView.width, OneView.height - 190 * px) andLineChartType:JHChartLineValueNotForEveryX];
        
        /* X轴的刻度值 可以传入NSString或NSNumber类型  并且数据结构随折线图类型变化而变化 详情看文档或其他象限X轴数据源示例*/
        lineChart.xLineDataArr = self.incomeAccountingMapTimeArray;
        
        /* 折线图的不同类型  按照象限划分 不同象限对应不同X轴刻度数据源和不同的值数据源 */
        lineChart.lineChartQuadrantType = JHLineChartQuadrantTypeFirstQuardrant;
        
        /* 数据源 */
        lineChart.valueArr = @[self.incomeRepaymentMapArray,self.incomeAccountingMapArray];
        
        /* 值折线的折线颜色 默认暗黑色*/
        lineChart.valueLineColorArr =@[WYCRGBColor(61, 93, 184), FontColor];
        
        
        lineChart.backgroundColor = [UIColor clearColor];
        /* 值点的颜色 默认橘黄色*/
        lineChart.pointColorArr = @[WYCRGBColor(61, 93, 184),FontColor];
        
        /* X和Y轴的颜色 默认暗黑色 */
        lineChart.xAndYLineColor = [UIColor clearColor];
        
        /* XY轴的刻度颜色 m */
        lineChart.xAndYNumberColor = [UIColor whiteColor];
        
        /* 坐标点的虚线颜色 */
        lineChart.positionLineColorArr = @[[UIColor clearColor],[UIColor clearColor]];
        [OneView addSubview:lineChart];
        [lineChart showAnimation];
        
    }else if (indexPath.section == 3){
        
        /** 背景*/
        UIView * OneView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 230 * px)];
        OneView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:OneView];
        
        
        /** 总额*/
        UILabel * TotalLabel = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, 30 * px, ScreenWidth * 0.5, 60 * px)];
        TotalLabel.textColor = [UIColor whiteColor];
        TotalLabel.text = [NSString stringWithFormat:@"￥%@",self.otherMoney];
        TotalLabel.textAlignment = NSTextAlignmentLeft;
        TotalLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        [OneView addSubview:TotalLabel];
        
        
        /** 总额*/
        UILabel * TotalTitle = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, CGRectGetMaxY(TotalLabel.frame) + 20 * px, 100 * px, 50 * px)];
        TotalTitle.textColor = [UIColor blackColor];
        TotalTitle.backgroundColor = WYCRGBColor(95, 207, 185);
        TotalTitle.layer.cornerRadius = 10 * px;
        TotalTitle.text = @"总额";
        TotalTitle.textAlignment = NSTextAlignmentCenter;
        TotalTitle.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
        [OneView addSubview:TotalTitle];
        
        
        
        
        
        UIView * TowView = [[UIView alloc] initWithFrame:CGRectMake(30 * px, CGRectGetMaxY(OneView.frame) + 20 * px, ScreenWidth - 60 * px, 600 * px)];
        TowView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:TowView];
        
        
        
        self.lineChart = [[LFLineChart alloc] initWithFrame:CGRectMake(0, 0,TowView.width, TowView.height)];
        self.lineChart.backgroundColor = [UIColor clearColor];
        // 设置折线图属性
        self.lineChart.title = @""; // 折线图名称
        NSMutableArray *orderedArray = [[NSMutableArray alloc]init];
        float max = 0;
        for(int i = 0; i < 8; i++){
            
            NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
            NSString *xValue;
            NSString *yValue;
            xValue = [NSString stringWithFormat:@"%d",i];
            
            yValue = [NSString stringWithFormat:@"%d",i];
            if ([yValue floatValue]>max) {
                max = [yValue floatValue];
            }
            dict = [@{
                      @"item": xValue, @"count":yValue
                      } mutableCopy];
            [orderedArray addObject:dict];
            
        }
        
        self.lineChart.maxValue = max;
        if (max == 0) {
            self.lineChart.maxValue = 1;
        }
        self.lineChart.xScaleMarkLEN = [UIScreen mainScreen].bounds.size.width / orderedArray.count;
        
        if (self.incomeOtherMoneyMapArray.count > 0) {
            [self.lineChart setXMarkTitlesAndValues:self.incomeOtherMoneyMapArray titleKey:@"item" valueKey:@"count"]; // X轴刻度标签及相应的值
        } else {
            [self.lineChart setXMarkTitlesAndValues:orderedArray titleKey:@"item" valueKey:@"count"]; // X轴刻度标签及相应的值
        }
        
        //设置完数据等属性后绘图折线图
        [self.lineChart mapping];
        [TowView addSubview:self.lineChart];
        //头顶上的时间标志
        UILabel * unitLabel = [[UILabel alloc]initWithFrame:CGRectMake(40 * px, 10 * px, 200 * px, 50 * px)];
        unitLabel.text = @"收款趋势";
        unitLabel.backgroundColor = backgroundcolor;
        unitLabel.layer.cornerRadius = 25 * px;
        unitLabel.layer.masksToBounds = YES;
        unitLabel.textColor = [UIColor whiteColor];
        unitLabel.textAlignment = NSTextAlignmentCenter;
        unitLabel.font = [UIFont systemFontOfSize:SYRealValue(20 / 2)];
        [TowView addSubview:unitLabel];
        
    }else{
        
        /** 背景*/
        UIView * OneView = [[UIView alloc] initWithFrame:CGRectMake(30 * px, 0, ScreenWidth - 60 * px, 900 * px)];
        OneView.backgroundColor = BackViewColor;
        [cell.contentView addSubview:OneView];
        
        
        /** 总额*/
        UILabel * RechargeTitle = [[UILabel alloc] initWithFrame:CGRectMake(60 * px, 30 * px, 200 * px, 50 * px)];
        RechargeTitle.textColor = [UIColor blackColor];
        RechargeTitle.backgroundColor = WYCRGBColor(95, 207, 185);
        RechargeTitle.layer.cornerRadius = 10 * px;
        RechargeTitle.text = @"招待总额";
        RechargeTitle.textAlignment = NSTextAlignmentCenter;
        RechargeTitle.font = [UIFont systemFontOfSize:SYRealValue(26 / 2)];
        [OneView addSubview:RechargeTitle];
        
        
        /** 总额*/
        UILabel * RechargeLabel = [[UILabel alloc] initWithFrame:CGRectMake(RechargeTitle.x, CGRectGetMaxY(RechargeTitle.frame) + 20 * px, ScreenWidth * 0.5, 60 * px)];
        RechargeLabel.textColor = [UIColor whiteColor];
        RechargeLabel.text = [NSString stringWithFormat:@"￥%@",self.rewardMoney];
        RechargeLabel.textAlignment = NSTextAlignmentLeft;
        RechargeLabel.font = [UIFont systemFontOfSize:SYRealValue(28 / 2)];
        [OneView addSubview:RechargeLabel];
        
        
        //头顶上的时间标志
        UILabel * unitLabel = [[UILabel alloc]initWithFrame:CGRectMake(40 * px, CGRectGetMaxY(RechargeLabel.frame) + 10 * px, 200 * px, 50 * px)];
        unitLabel.text = @"招待趋势";
        unitLabel.backgroundColor = backgroundcolor;
        unitLabel.layer.cornerRadius = 25 * px;
        unitLabel.layer.masksToBounds = YES;
        unitLabel.textColor = [UIColor whiteColor];
        unitLabel.textAlignment = NSTextAlignmentCenter;
        unitLabel.font = [UIFont systemFontOfSize:SYRealValue(20 / 2)];
        [OneView addSubview:unitLabel];
        
        self.lineChart = [[LFLineChart alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(unitLabel.frame),OneView.width, 600 * px)];
        self.lineChart.backgroundColor = [UIColor clearColor];
        // 设置折线图属性
        self.lineChart.title = @""; // 折线图名称
        NSMutableArray *orderedArray = [[NSMutableArray alloc]init];
        float max = 0;
        for(int i = 0; i < 8; i++){
            
            NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
            NSString *xValue;
            NSString *yValue;
            xValue = [NSString stringWithFormat:@"%d",i];
            
            yValue = [NSString stringWithFormat:@"%d",i];
            if ([yValue floatValue]>max) {
                max = [yValue floatValue];
            }
            dict = [@{
                      @"item": xValue, @"count":yValue
                      } mutableCopy];
            [orderedArray addObject:dict];
            
        }
        
        self.lineChart.maxValue = max;
        if (max == 0) {
            self.lineChart.maxValue = 1;
        }
        self.lineChart.xScaleMarkLEN = [UIScreen mainScreen].bounds.size.width / orderedArray.count;
        
        if (self.incomeRewardMapArray.count > 0) {
            [self.lineChart setXMarkTitlesAndValues:self.incomeRewardMapArray titleKey:@"item" valueKey:@"count"]; // X轴刻度标签及相应的值
        } else {
            [self.lineChart setXMarkTitlesAndValues:orderedArray titleKey:@"item" valueKey:@"count"]; // X轴刻度标签及相应的值
        }
        
        //设置完数据等属性后绘图折线图
        [self.lineChart mapping];
        [OneView addSubview:self.lineChart];
       
        
        
    }
    
    return cell;
}

@end
